import {IsNotEmpty,IsEmail,IsPhoneNumber,IsString} from 'class-validator'
import { IsValidPassword } from 'src/validator/paramvalidator/paramvalidator.decorator'
export class RegistUserDto {
    @IsNotEmpty({message:'账号不能为空'})
    @IsString({message:'账号必须为字符'})
    account:string

    @IsNotEmpty({message:'密码不能为空'})
    @IsValidPassword({message:'密码至少包含一个大写字母、一个小写字母、一个数字和一个特殊字符，并且长度至少为8个字符'})
    password:string

    @IsEmail({},{message:'不符合邮箱格式'})
    @IsString({message:'邮箱必须为字符'})
    email:string

    @IsPhoneNumber('CN',{message:'不符合手机格式'})
    @IsString({message:'手机必须为字符'})
    phone:string
}
